<?php
class Disposal extends AppModel {
	var $name = 'Disposal';
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Item' => array(
			'className' => 'Item',
			'foreignKey' => 'item_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	function afterFind($results) {
		foreach ($results as $key => $val) {
			if (isset($val['Disposal']['disposal_date'])) {
				$results[$key]['Disposal']['disposal_date'] = $this->dateFormatAfterFind($val['Disposal']['disposal_date']);
		
			}
	
		}
	
		return $results;
	}

	function dateFormatAfterFind($dateString) {
		return date('d-M-Y', strtotime($dateString));
		}
}
